package 对撞指针;

public class LeetCode344_反转字符串 {
    public void reverseString(char[] s) {
        int left = 0;
        int right = s.length - 1;
        while(left < right) {
            swap(s,left,right);
            left++;
            right--;
        }
    }
    private void swap(char[] s,int i,int j) {
        char ch = s[i];
        s[i] = s[j];
        s[j] = ch;
    }
}
